package com.sl.weixin.test;

import com.alibaba.fastjson.JSONObject;
import org.weixin4j.Weixin;
import org.weixin4j.WeixinException;
import org.weixin4j.model.menu.ClickButton;
import org.weixin4j.model.menu.Menu;
import org.weixin4j.model.menu.SingleButton;
import org.weixin4j.model.menu.ViewButton;

import java.util.ArrayList;
import java.util.List;

public class Weixintest {
    public static void main(String[] args) throws WeixinException {
        Weixin weixin=new Weixin();

        List<SingleButton> singleButtonList=new ArrayList<>();
        //List<SingleButton> singleButtonsubList=new ArrayList<>();
        SingleButton singleButton1=new ViewButton();
        SingleButton singleButton2=new ViewButton();
        SingleButton singleButton3=new ViewButton();
        //SingleButton singleButton4=new SingleButton();

        singleButton1.setName("按钮1");
        ((ViewButton) singleButton1).setUrl("https://www.baidu.com");

        singleButton2.setName("按钮2");
        singleButton3.setName("按钮3");
        //singleButton4.setName("子按钮一");
        //singleButtonsubList.add(singleButton4);
        //singleButton1.setSubButton(singleButtonsubList);
        //singleButton2.setSubButton(singleButtonsubList);
        //singleButton3.setSubButton(singleButtonsubList);
        //singleButtonList.add(singleButton1);
        //singleButtonList.add(singleButton2);
        //singleButtonList.add(singleButton3);
        Menu menu = new Menu();
        menu.setButton(singleButtonList);
        weixin.menu().create(menu);

        SingleButton singleButton=new ViewButton();
    }
}
